import React from 'react';
import { Form, InputNumber } from 'antd';
// import { SelectCustom, DutyTreeSelect } from '@/containers';
import { SelectCustom } from '@/containers';
// import { InfoIcon } from '@/molecules';
// import DutySelect from '@/components/DutySelect';

const Base = ({ form, data, ...rest }) => {
    const { getFieldDecorator } = form;

    return (
        <Form {...rest}>
            <Form.Item label="全职试用期">以录用申请为准</Form.Item>
            <Form.Item label="非全职试用期" style={{ marginBottom: 0 }} required>
                <div style={{ display: 'flex' }}>
                    <Form.Item label="" style={{ flex: 1 }}>
                        {getFieldDecorator('probationPeriodNumber', {
                            initialValue: data?.probationPeriodNumber || 6,
                            rules: [
                                {
                                    required: true,
                                    message: '试用考评期不能为空'
                                }
                            ]
                        })(
                            <InputNumber
                                placeholder="请输入"
                                allowClear
                                min={1}
                                max={999}
                                precision={0}
                                style={{ width: '100%' }}
                            />
                        )}
                    </Form.Item>
                    <Form.Item label="" style={{ marginLeft: 16, flex: 1 }}>
                        {getFieldDecorator('probationPeriodType', {
                            initialValue: data?.probationPeriodType || 1,
                            rules: [
                                {
                                    required: true,
                                    message: '请选择'
                                }
                            ]
                        })(
                            <SelectCustom
                                allowClear={false}
                                dataSource={[
                                    { label: '月', value: 1 },
                                    { label: '天', value: 2 }
                                ]}
                            />
                        )}
                    </Form.Item>
                </div>
            </Form.Item>
            {/* <Form.Item
                label={
                    <InfoIcon title="若岗位上有多名员工的时候，系统将自动为新员工分配人事负责人">人事负责人</InfoIcon>
                }
            >
                {getFieldDecorator('guiderHr', {
                    initialValue: data?.guiderHr || undefined,
                    rules: [
                        {
                            required: true,
                            message: '岗位不能为空'
                        }
                    ]
                })(
                    <DutyTreeSelect
                        placeholder="请选择岗位"
                        style={{ width: '100%' }}
                        getPopupContainer={trigger => trigger.parentNode}
                    />
                )}
            </Form.Item> */}
        </Form>
    );
};

export default Base;
